package com.wit.locker.aspect;


import org.aspectj.lang.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class HttpAspect {

    private final static Logger logger = LoggerFactory.getLogger(HttpAspect.class);

//    @Before("execution(public * com.wit.locker.controller.*(..))")
//    public void log() {
//
//    }

    @Pointcut("execution(public * com.wit.locker.controller.*.*(..))")
    public void log() {
    }



    @Before("log()")
    public void logBefore() {

    }

    @After("log()")
    public void logAfter() {

    }

    @AfterReturning(pointcut = "log()", returning = "object")
    public void logReturning(Object object) {
        logger.info("response={}", object.toString());
    }

}
